{template 'common/header'}
 <ul class="we7-page-tab"> 
	<li><a href="./index.php?c=profile&a=module&do=setting&m=tyzm_diamondvote">投票数据</a></li>
    <li><a href="./index.php?c=profile&a=module&do=setting&m=tyzm_diamondvote&ty=1">参数设置</a></li>
	{if $_W['role'] == 'founder'}
	<li class="active"}><a href="./index.php?c=site&a=entry&do=auth&m=tyzm_diamondvote">系统升级</a></li>
	{/if}
</ul>
<div class="main">
	<form action="" method="post" class="form-horizontal form" id="form">
		<div class="panel panel-default">
			<div class="panel-heading">系统授权</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">域名</label>
					<div class="col-xs-12 col-sm-8">
						<input type="text" name="domain" class="form-control" value="{$domain}" readonly/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">IP地址</label>
					<div class="col-xs-12 col-sm-8">
						<input type="text" name="ip" class="form-control" value="{$ip}" readonly/>
					</div>
				</div>
					<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">授权码</label>
					<div class="col-xs-12 col-sm-8">
						<input type="text" name="code" class="form-control" value="{$code}" placeholder='请填写授权码' />
						<span class="help-block">请联系客服索取授权码，保护好您的授权码，避免泄漏</span>
					</div>
				</div>
				<div class="form-group">
                    <label class="col-sm-2 control-label">授权状态</label>
                    <div class="col-sm-8 col-xs-12">
                        <div class='form-control-static'>
                           	{if !empty($status)}
                            <span class='label label-success'>已授权</span>
                            {elseif $status==0}
                            <span class='label label-danger'>未授权</span>
                            {/if}
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">授权购买</label>
                    <div class="col-sm-8 col-xs-12">
                        <div class='form-control-static'><a href='http://www.hikehu.com' target='_blank'>立即购买（授权码）</a></div>
                    </div>
                </div>			
                {if $_W['isfounder']}
                <div class="form-group">
                    <label class="col-sm-2 control-label">官方网站</label>
                    <div class="col-sm-8 col-xs-12">
                        <div class='form-control-static'><a href='http://www.hikehu.com' target='_blank'>http://www.hikehu.com</a></div>
                        {if empty($status)}
                        <span class='help-block'>如果您正在使用非正版授权，请您尊重我们的劳动成果，谢谢您~</span>
                        <span class='help-block'>盗版有风险，请谨慎使用!</span>
                        {/if}
                    </div>
                </div>
                {/if}
				<div class="form-group">
					<div class="col-xs-12 col-sm-9 col-md-10 col-lg-10 col-sm-offset-3 col-md-offset-2 col-lg-offset-2">
						<input name="submit" type="submit" value="验证授权" class="btn btn-primary" />
						<input type="hidden" name="token" value="{$_W['token']}" />
						{if !empty($status)}
						<input type="button" style="margin-left:10px;" onclick="location.href='index.php?c={$_GPC['c']}&a={$_GPC['a']}&m={$_GPC['m']}&do=upgrade'" value="系统升级" class="btn btn-success" />
						{/if}
					</div>
				</div>
			</div>
		</div>
	</form>
</div>
<script>
require(['jquery', 'util'], function($, util){
	$(function(){
		$('#form').submit(function(){
			if($('input[name="code"]').val() == ''){
				util.message('请输入授权码.');
				return false;
			}
			if($('input[name="domain"]').val() == ''){
				util.message('未获取到域名.');
				return false;
			}
			return true;
		});
	});
});
</script>
</div>
{template 'common/footer'}